Skip to content

feat(tools): 7-tool parity and description refresh - #1432

Merged
graphite-app[bot] merged 1 commit into
mainfrom
feat/tools-seven-tool-parity
Sep 1, 2026
Merged

feat(tools): 7-tool parity and description refresh#1432
graphite-app[bot] merged 1 commit into
mainfrom
feat/tools-seven-tool-parity

Conversation

@Dhravya

@Dhravya Dhravya commented Aug 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Refresh canonical tool descriptions in tools-shared.ts
  • Align OpenAI and AI SDK tool bindings with 7-tool surface
  • Export TOOL_DESCRIPTIONS / PARAMETER_DESCRIPTIONS from package index

Stacked on #1431

Test plan

  • bun run test:unit in packages/tools

Made with Cursor

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 8, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
supermemory-mcp de3bbb3 Sep 01 2026, 06:06 AM

@claude

claude Bot commented Aug 8, 2026

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 8, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
supermemory-app de3bbb3 Commit Preview URL

Branch Preview URL
Sep 01 2026, 06:07 AM

Comment on lines +165 to +180
it.each(["$&", "$'", "$`", "$$"])(
"stores %s literally instead of expanding it as a replacement pattern",
async (dollarSequence) => {
const result = await tool.handleCommand({
command: "str_replace",
path: FILE_PATH,
old_str: "line3",
new_str: `price is ${dollarSequence} today`,
})

expect(result.success).toBe(true)
expect(addMock).toHaveBeenCalledTimes(1)
const stored = addMock.mock.calls[0]?.[0]?.content as string
expect(stored).toContain(`price is ${dollarSequence} today`)
},
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test regression: the assertion expect(stored).not.toContain("line3") was removed during reformatting. The test now only verifies the new string was added but doesn't verify the old string was actually replaced. This weakens test coverage and won't catch if str_replace fails to remove the old content.

expect(stored).toContain(`price is ${dollarSequence} today`)
expect(stored).not.toContain("line3") // Add this back
Suggested change
it.each(["$&", "$'", "$`", "$$"])(
"stores %s literally instead of expanding it as a replacement pattern",
async (dollarSequence) => {
const result = await tool.handleCommand({
command: "str_replace",
path: FILE_PATH,
old_str: "line3",
new_str: `price is ${dollarSequence} today`,
})
expect(result.success).toBe(true)
expect(addMock).toHaveBeenCalledTimes(1)
const stored = addMock.mock.calls[0]?.[0]?.content as string
expect(stored).toContain(`price is ${dollarSequence} today`)
},
)
it.each(["$&", "$'", "$`", "$$"])(
"stores %s literally instead of expanding it as a replacement pattern",
async (dollarSequence) => {
const result = await tool.handleCommand({
command: "str_replace",
path: FILE_PATH,
old_str: "line3",
new_str: `price is ${dollarSequence} today`,
})
expect(result.success).toBe(true)
expect(addMock).toHaveBeenCalledTimes(1)
const stored = addMock.mock.calls[0]?.[0]?.content as string
expect(stored).toContain(`price is ${dollarSequence} today`)
expect(stored).not.toContain("line3") // Add this back
},
)

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Dhravya commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

Comment thread packages/tools/src/ai-sdk.ts Outdated
Comment thread packages/tools/src/claude-memory.ts Outdated
Comment thread packages/tools/src/tools-shared.ts Outdated
@socket-security

socket-security Bot commented Aug 18, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​supermemory@​4.25.46610010095100

View full report

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview: This PR upgrades the supermemory SDK from v3 to v4, aligns 7 tool bindings with the new API surface, and refreshes tool descriptions for clarity.

Issues found: The missing test assertion (expect(stored).not.toContain("line3")) was already flagged by Graphite — this is a real test coverage regression that should be restored. The other Graphite comments (unused includeFullDocs, implicit any type, Biome formatting) are linter/style issues.

The core implementation changes are solid:

  • The deleteDocumentByIdentifier logic properly resolves IDs within scoped container tags before deletion, preventing cross-scope data access
  • The container tag validation correctly rejects empty strings
  • The getFileDocument refactor to use document listing + GET instead of search is more reliable for exact-match file operations
  • Error handling for ambiguous document identifiers is appropriate

Score: 9/10 — Clean logic, improved scoping safety. Restore the dropped test assertion before merging.


// The current SDK always supplies status. Keeping undefined permissive lets
// older SDKs and lightweight client doubles continue to work.
const status = (document as { status?: string }).status

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expression (document as { status?: string }).status uses a type assertion (as) to cast document to access the status property. The style guide states: 'Avoid unnecessary type assertions' and 'Use type annotations instead of assertions for object literals.' Instead of asserting the type inline, the function parameter type should be widened or a proper interface/type should be used so the assertion is unnecessary.

Spotted by Graphite (based on custom rule: TypeScript style guide (Google))

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview: This PR upgrades the supermemory SDK from v3 to v4, aligns the 7-tool surface with the new API, and hardens container-tag scoping for safe deletions.

Issues found: The test assertion expect(stored).not.toContain("line3") was removed from claude-memory.test.ts (line 208) — this is a test coverage regression already flagged by Graphite. The test should verify the old content is replaced, not just that new content exists. Restore it before merging.

The core security logic is solid:

  • deleteDocumentByIdentifier properly resolves IDs within scoped container tags before deletion
  • hasCompleteContainerTagScope correctly requires ALL document tags be within the expected scope (prevents cross-scope deletion)
  • Terminal status checks prevent deleting documents mid-processing
  • Empty/ambiguous identifier handling is careful

The other Graphite comments (unused includeFullDocs, implicit any type, Biome formatting) are lint/style issues that should be cleaned up.

Score: 9/10 — Clean security logic, well-designed scoping. Fix the test regression before merging.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview: Upgrades the supermemory SDK from v3 to v4, aligns 7 tool bindings with the new API surface, and hardens container-tag scoping for safe deletions.

Issues found:

  1. Test regression (already flagged by Graphite): The assertion expect(stored).not.toContain("line3") was removed from claude-memory.test.ts:211. This weakens test coverage — the test now only verifies new content exists but doesn't verify old content was replaced. Restore before merging.

  2. Lint issues (already flagged): Unused includeFullDocs parameter in ai-sdk.ts, implicit any type on match.metadata in claude-memory.ts. Minor cleanup needed.

The core implementation is solid:

  • deleteDocumentByIdentifier properly resolves IDs within scoped container tags before deletion, preventing cross-scope data access
  • hasCompleteContainerTagScope correctly requires ALL document tags be within expected scope
  • Terminal status checks prevent deleting documents mid-processing
  • getFileDocument refactor to use document listing + GET is more reliable for exact-match file operations
  • Empty container tag validation is appropriate

Score: 9/10 — Clean security logic, well-designed scoping. Fix the test regression and lint issues before merging.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview: Upgrades the supermemory SDK from v3 to v4, aligns the 7-tool surface with the new API, and hardens container-tag scoping for safe deletions.

Issues found:

  1. Test regression (already flagged by Graphite): The assertion expect(stored).not.toContain("line3") was removed from claude-memory.test.ts:211. The test now only verifies new content exists but doesn't verify old content was replaced — this weakens coverage for the str_replace operation. Restore before merging.

The core implementation is solid:

  • deleteDocumentByIdentifier properly resolves IDs within scoped container tags before deletion, preventing cross-scope data access
  • hasCompleteContainerTagScope correctly requires ALL document tags be within the expected scope (prevents cross-scope deletion)
  • Terminal status checks prevent deleting documents mid-processing
  • Empty container tag validation rejects misconfigured clients
  • getFileDocument refactor from search→list+get is more reliable for exact-match file operations
  • The deferAPIPromise wrapper in OpenAI middleware correctly preserves APIPromise semantics for SDK compatibility

The other Graphite comments (unused includeFullDocs, implicit any type, Biome formatting, type assertion style) are lint/style cleanup — not bugs.

Score: 9/10 — Clean SDK migration, well-designed scoping safety. Fix the test regression before merging.

@graphite-app

graphite-app Bot commented Sep 1, 2026

Copy link
Copy Markdown

Merge activity

@graphite-app
graphite-app Bot force-pushed the chore/ci-python-sdk-tests branch 2 times, most recently from 3bc0dd5 to 4ae703d Compare September 1, 2026 04:38
@Dhravya
Dhravya changed the base branch from chore/ci-python-sdk-tests to graphite-base/1432 September 1, 2026 05:58
@Dhravya
Dhravya force-pushed the feat/tools-seven-tool-parity branch from 6fac90e to d105cf5 Compare September 1, 2026 05:58
@Dhravya
Dhravya changed the base branch from graphite-base/1432 to main September 1, 2026 05:58
## Summary
- Refresh canonical tool descriptions in `tools-shared.ts`
- Align OpenAI and AI SDK tool bindings with 7-tool surface
- Export `TOOL_DESCRIPTIONS` / `PARAMETER_DESCRIPTIONS` from package index

Stacked on #1431

## Test plan
- [ ] `bun run test:unit` in `packages/tools`

Made with [Cursor](https://cursor.com)
@graphite-app
graphite-app Bot force-pushed the feat/tools-seven-tool-parity branch from d105cf5 to de3bbb3 Compare September 1, 2026 06:00
@mintlify

mintlify Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
supermemory 🟢 Ready View Preview Sep 1, 2026, 6:00 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

graphite-app Bot pushed a commit that referenced this pull request Sep 1, 2026
## Summary
- Re-export full tool set from `@supermemory/tools/ai-sdk`
- Add unit tests for tool re-exports

Stacked on #1432

## Test plan
- [ ] `bun run test:unit` in `packages/ai-sdk`

Made with [Cursor](https://cursor.com)
@graphite-app
graphite-app Bot merged commit de3bbb3 into main Sep 1, 2026
17 of 19 checks passed
@polylane

polylane Bot commented Sep 1, 2026

Copy link
Copy Markdown

Note

Production impact unlikely.

Checked the packages/tools rewrite, CI workflows, and docs against the attached workers; supermemory-mcp (apps/mcp) and supermemory-app (apps/web) neither import nor depend on @supermemory/tools, so this PR ships no runtime code to production.

View the full analysis →

Failure trajectories: none plausible. 1 failure mode was considered and refuted against observed production traffic.

Refuted trajectory (1): what was ruled out, and why
  • Tools library rewrite reaches supermemory-mcp / supermemory-app at runtime: apps/mcp/wrangler.jsonc (name supermemory-mcp) and apps/web/wrangler.jsonc (name supermemory-app) are the deploy sources; both source trees have zero imports of @supermemory/tools and both package.json files omit it, so the changed library is published to npm and consumed by external users, never bundled into these workers. CI and docs hunks are inert at runtime.

Dependency changes

Package Change Jump Release age
supermemory 3.0.0-alpha.264.25.4 major 29 days

view-investigation review-in-polylane disable-pr-reviews

Polylane analysed de3bbb3 for production impact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants